package com.chinaisafe.user.dto;

import com.chinaisafe.user.entity.SysUserPwdRecord;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.io.Serializable;

/**
 * SysUserPwdRecordDTO
 * Description：用户密码记录数据传输对象
 *
 * @author xuefu.shu
 * @date  2024-07-12 09:55:54
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@Schema(name = "SysUserPwdRecordDTO", description = "用户密码记录数据传输对象")
public class SysUserPwdRecordDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "主键id")
    private Long id;

    @Schema(description = "用户_id")
    private Long sysUserId;

    @Schema(description = "密码")
    private String password;


    /**
     * 将实体类转换为数据传输对象
     * @param entity 实体对象
     * @return SysUserPwdRecordDTO 数据传输对象
     * @author xuefu.shu
     * @date 2024-07-12 09:55:54
     */
    public static SysUserPwdRecordDTO convertFromEntity(SysUserPwdRecord entity) {
        SysUserPwdRecordDTO dto = new SysUserPwdRecordDTO();
        dto.id = entity.getId();
        // 给对应的字段赋值 可根据实际业务删减
        dto.sysUserId = entity.getSysUserId();
        dto.password = entity.getPassword();
        return dto;
    }
}
